package org.lee.app.controller;

import org.lee.common.domain.Result;
import org.lee.whitelist.annotation.DoFilter;
import org.lee.whitelist.domain.UserInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * HelloWordController
 *
 * @author dralee
 * @date 2021-11-22 17:04:39
 **/
@RestController
@RequestMapping("/api")
public class HelloWordController {

    @DoFilter(key = "userId", returnJson = "{\"code\":502, \"message\":\"不在白名单内，无法访问\"}")
    @GetMapping("queryUserInfo")
    public Result queryUserInfo(@RequestParam String userId) {
        return Result.success(UserInfo.builder().userId(userId).age(20).address("深圳市龙华区民治街道ABC号").build());
    }

}
